﻿@{
    ViewData["Title"] = "Home Page";
    Layout = "_Layout";
    var teacher = Model;
}


    <fieldset class="layui-elem-field" style="margin: 20px">
        <legend>亲爱的 @teacher.Tname 老师，欢迎您！</legend>
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend><button class="layui-btn layui-btn-warm layui-btn-radius" onclick="select1()">查看我的当月工资</button></legend>
        </fieldset>
        <div class="layui-field-box">
            <div class="layui-form">
                <table class="layui-table">
                    <colgroup>
                        <col width="150">
                        <col width="150">
                        <col width="200">
                        <col>
                    </colgroup>
                    <thead>
                        <tr>
                            <th>教师编号</th>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>职称</th>
                            <th>入职时间</th>
                            <th>工作部门</th>
                            <th>联系方式</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>@teacher.Teacherid</td>
                            <td>@teacher.Tname</td>
                            <td>@teacher.Sex</td>
                            <td>@teacher.Profession</td>
                            <td>@teacher.EntryTime</td>
                            <td>@teacher.Departmentid</td>
                            <td>@teacher.Phone</td>
                        </tr>

                    </tbody>
                </table>
            </div>
        </div>
    </fieldset>

<fieldset class="layui-elem-field" style="margin: 20px">
    <legend>您的申请信息</legend>
    <div class="layui-field-box">

        <table class="layui-hide" id="checkA" lay-filter="test"></table>  @*显示查到的奖惩申请*@

        <table class="layui-hide" id="checkC" lay-filter="test"></table>  @*显示查到的会议申请*@

        <table class="layui-hide" id="checkG" lay-filter="test"></table>  @*显示查到的物资申请*@

        <table class="layui-hide" id="checkW" lay-filter="test"></table>  @*查询自己的工资*@
    </div>
</fieldset>



@section Scripts{
    <script src="~/layui-v2.5.5/layui/layui.all.js" charset="utf-8"></script>
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
    <!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
    <script>
//登录直接显示
    $(function () {
            layui.use('table', function () {
                var table = layui.table;
                $.ajax({
                    url: '/Api/CheckAwardPunish',
                    data: {
                        //查询奖惩不传递值
                    },
                    success: function (data) {  //当请求成功时运行的函数；变量：接受服务器响应结果的值
                        //alert(data.msg);
                        table.render({
                            elem: '#checkA'
                            , title: 'wage Table'
                            , page: true //开启分页
                            , toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
                            , defaultToolbar: ['filter']
                            , cols: [[ //表头
                                { field: 'sid', title: '学生学号', fixed: 'left' }
                                , { field: 'studentName', title: '学生姓名', fixed: 'left' }
                                , { field: 'sex', title: '性别', fixed: 'left' }
                                , { field: 'grade', title: '年级', fixed: 'left' }
                                , { field: 'studentClass', title: '班级', fixed: 'left' }
                                , { field: 'title', title: '奖惩标题', fixed: 'left' }
                                , { field: 'content', title: '具体内容' }
                                , { field: 'punishContent', title: '惩罚措施' }
                                , { field: 'awardContent', title: '奖励措施' }
                                , { field: 'applyTime', title: '申请时间' }
                                , { field: 'checkTime', title: '确认时间' }
                                , { field: 'issue', title: '驳回原因，修改意见' }
                                , { field: 'state', title: '申请状态', }
                            ]]
                            , data: data.filelist
                            , even: true
                        });
                        layer.msg("欢迎您");
                    },
                })
                var tidd = '@teacher.Teacherid'
                layui.use('table', function () {
                    var table = layui.table;
                    $.ajax({
                        url: '/Api/CheckConventionByTid',
                        data: {
                            'Tid': tidd
                            //查询会议传递教师id
                        },
                        success: function (data) {  //当请求成功时运行的函数；变量：接受服务器响应结果的值
                            table.render({
                                elem: '#checkC'
                                , title: 'wage Table'
                                , page: true //开启分页
                                , toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
                                , defaultToolbar: ['filter']
                                , cols: [[ //表头
                                    { field: 'startTime', title: '会议开始时间' }
                                    , { field: 'endTime', title: '会议结束时间' }
                                    , { field: 'place', title: '会议地点' }
                                    , { field: 'state', title: '申请状态' }
                                ]]
                                , data: data.filelist
                                , even: true
                            });
                        },
                    })
                });

                var tid2 = '@teacher.Teacherid'
                layui.use('table', function () {
                    var table = layui.table;
                    $.ajax({
                        url: '/Api/CheckMaterialByTId',
                        data: {
                            'Tid': tid2
                        },
                        success: function (data) {
                            table.render({
                                elem: '#checkG'
                                , title: 'wage Table'
                                , page: true //开启分页
                                , toolbar: '#toolbarDemo'
                                , defaultToolbar: ['filter']
                                , cols: [[
                                    { field: 'goodsname', title: '物资名称' }
                                    , { field: 'goodsnum', title: '物资数量' }
                                    , { field: 'remarks', title: '采购原因' }
                                    , { field: 'state', title: '物资申请状态' }

                                ]]
                                , data: data.filelist
                                , even: true
                            });
                        },
                    })



                });
            });
        });
    </script>
    <script>
        function select1() {
            layui.use('layer', function () {
                var layer = layui.layer;
                layer.open({
                    type: 2,
                    title: false,
                    closeBtn: 1, //显示关闭按钮
                    shade: [0],
                    area: ['500px', '500px'],
                    offset: 'auto',
                    anim: 2,
                    content: ['/js/PersonWage', 'no'], //iframe的url，no代表不显示滚动条
                });
            });
        }
    </script>
}